<%@ page import="edu.uow.devdocs.DevelopmentTask" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'issue.label', default: 'Task')}" />
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
	</head>
	<body>
		<h1><g:message code="default.edit.label" args="[entityName]" /></h1>
	<div id="tabs">
		<ul>
			<li><a href="#tabTask">Task</a></li>
			<li><a href="#tabAssigned">Assigned</a></li>
			<li><a href="#tabTimeTracker">Track Time</a></li>
			<li><a href="#tabComments">Comments</a></li>
			<li><a href="#tabAttachments">Attachment</a></li>
			<li><a href="#tabChecklist">Checklists</a></li>
		</ul>
		<div id="tabTask" class="content scaffold-edit" role="main">
			<g:flashMessage/>
			<g:hasErrors bean="${developmentTaskInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${developmentTaskInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form method="post" class="columns">
				<g:hiddenField name="id" value="${developmentTaskInstance?.id}" />
				<g:hiddenField name="version" value="${developmentTaskInstance?.version}" />
				<g:render template="form"/>
				<fieldset class="form-actions">
					<g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
					<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
				</fieldset>
			</g:form>
		</div>
		<div id="tabAssigned">
			<g:render template="/shared/addAssignment" model="['developmentTaskId':developmentTaskInstance?.id,'projectId':developmentTaskInstance?.project.id]"/>
		</div>		
		<div id="tabTimeTracker">
			<g:render template="/shared/addTimeTracker" model="['developmentTaskId':developmentTaskInstance?.id,'projectId':developmentTaskInstance?.project.id]"/>
		</div>
		<div id="tabComments">
			<g:render template="/shared/addComments" model="['developmentTaskId':developmentTaskInstance?.id]"/>
		</div>
		<div id="tabAttachments">
			<g:render template="/shared/addAttachments" model="['developmentTaskId':developmentTaskInstance?.id,'projectId':developmentTaskInstance?.project.id]"/>
		</div>
		<div id="tabChecklist">
			<g:render template="/shared/addChecklist" model="['developmentTaskInstance':developmentTaskInstance,'projectId':developmentTaskInstance?.project.id]"/>
		</div>
	</div>
			<script>
			$(function() {
					$("#tabs").tabs();
			});
		</script>
	</body>

</html>
